﻿using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CommonLibrary
{
    class Program
    {
        static void Main(string[] args)
        {
            /// 功能：监听注册表值变化（demo 中以 监听PC模式和平板模式为例）
            //MonitorWindowsRegDemo demo = new MonitorWindowsRegDemo();
            //demo.RunDemo();
            // 注意释放资源
            //demo.Close();



            /// 功能：计算屏幕DPI值
            //WindowsScreenHelperDemo screenDemo = new WindowsScreenHelperDemo();
            //screenDemo.RunDemo();

            /// 功能：监听响应
            MonitorMsgHelperDemo.RunDemo();

            //DeviceEnableDemo.RunDemo(true);
            //GetRunPath();
            Console.ReadKey();
        }

        static void GetRunPath()
        {
            Process[] ps = Process.GetProcesses();
            foreach (var p in ps)
            {
                string info = "";
                try
                {
                    string path = Path.GetDirectoryName(p.MainModule.FileName);
                    info = $"{p.Id}\r{p.ProcessName}\r{p.MainModule}";
                    //Console.WriteLine(path);
                }
                catch(Exception ex) 
                {
                    Console.WriteLine($"Error: {p.Id} {p.ProcessName} {ex.ToString()}");
                }
            }
        }
    }
}
